// 2 8 3 7 3 5 6 2 8 4 7 5 输入一串数字, 表示很多点, 然后只保留拐点,和两端点
const readline = require("readline");
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});
let initArr = [];
rl.on("line", (line)=>{
    if(initArr.length === 0) {
        let tempArr = line.trim().split(" ").map(Number)
        for (let i = 1; i < tempArr.length ; i+=2) {
            initArr.push([tempArr[i - 1], tempArr[i]])
        }
        getResult(initArr)
        // clear
        initArr.length = 0
    }

})

function getResult(initArr) {
    let validArr = new Array(initArr.length).fill(false)
    validArr[0] = true
    validArr[initArr.length - 1] = true

    for (let i = 1; i < initArr.length - 1 ; i++) {
        const [a, b] = initArr[i - 1]
        const [c, d] = initArr[i]
        const [e, f] = initArr[i + 1]
        if(!valid([a-c, b - d], [c - e, d - f])){
            validArr[i] = true;
        }
    }
    let result = []
    for (let i = 0; i < validArr.length; i++) {
        if(validArr[i]) {
            result.push(...initArr[i])
        }
    }
    console.log(result.join(" "))

}

function valid([x1, y1], [x2, y2]) {
    if(y1 === 0 && y2 === 0) return true
    if(y1 === 0 || y2 === 0) return false
    return x1 / y1 === x2 / y2;
}